<div class="entry-bg"></div>
<div class="container">
    <!--login start-->
    <div class="form-wrap reset-pwd">
        <form novalidate class="form-entry" name="pwdForm">
            <legend>
                <h2>修改密码</h2>
            </legend>
            <div class="row">
                <div class="col-md-7">
                    <div class="form-group height-70">
                        <label for="username">账号</label>
                        <input type="text" id="username" name="username" class="form-control" ng-blur="vm.checkValid(pwdForm.username)" required ng-model="vm.data.username">
                        <span class="error" ng-show="pwdForm.username.$invalid && !pwdForm.username.$pristine">账号不能为空</span>
                    </div>
                    <div class="form-group height-70">
                        <label for="oldPassword">旧密码</label>
                        <input type="password" id="oldPassword" name="oldPassword" class="form-control" ng-blur="vm.checkValid(pwdForm.oldPassword)" required ng-model="vm.data.oldPassword">
                        <span class="error" ng-show="pwdForm.oldPassword.$invalid && !pwdForm.oldPassword.$pristine">旧密码不能为空</span>
                    </div>
                    <div class="form-group height-70">
                        <label for="newPassword">新密码</label>
                        <input type="password" id="newPassword" name="newPassword" class="form-control" ng-blur="vm.checkValid(pwdForm.newPassword)" required ng-model="vm.data.newPassword">
                        <span class="error" ng-show="pwdForm.newPassword.$invalid && !pwdForm.newPassword.$pristine">新密码不能为空</span>
                    </div>
                    <div class="form-group height-70">
                        <label for="confirmPwd">确认密码</label>
                        <input type="password" id="confirmPwd" name="confirmPwd" class="form-control" ng-blur="vm.checkValid(pwdForm.confirmPwd)" required ng-model="vm.data.confirmPwd">
                        <span class="error" ng-show="pwdForm.confirmPwd.$invalid && !pwdForm.confirmPwd.$pristine">确认密码不能为空</span>
                        <span class="error" ng-show="pwdForm.confirmPwd.$valid && !pwdForm.confirmPwd.$pristine && (pwdForm.confirmPwd.$viewValue !== pwdForm.newPassword.$viewValue)">两次输入的密码不同</span>
                    </div>
                    <button type="button" class="btn btn-block btn-primary" ng-disabled="pwdForm.$invalid || vm.sLoading" ng-click="vm.resetPwd()"><span ng-if="!vm.sLoading">确认</span><span ng-if="vm.sLoading"><i class="fa fa-spin fa-spinner"></i></span></button>
                </div>
                <div class="col-md-5">
                    <div class="pwd-cont">
                        <p><strong>您的密码策略为</strong></p>
                        <div ng-if="!vm.pwdRule && !vm.pLoading">
                            <p><i class="fa fa-exclamation-circle margin-right-5"></i>暂无数据</p>
                        </div>
                        <div ng-if="!vm.pwdRule && vm.pLoading">
                            <p><i class="fa fa-spin fa-spinner margin-right-5"></i>数据加载...</p>
                        </div>
                        <table ng-if="vm.pwdRule && !vm.pLoading" class="table-pwd">
                            <colgroup>
                                <col style="width: 30%"/>
                                <col style="width: 70%"/>
                            </colgroup>
                            <tr>
                                <td>生命周期</td>
                                <td>{{vm.pwdRule.effectDays}}</td>
                            </tr>
                            <tr>
                                <td>密码提醒时间</td>
                                <td>{{vm.pwdRule.warnDays}}</td>
                            </tr>
                            <tr>
                                <td>重用时间间隔</td>
                                <td>{{vm.pwdRule.reuseIntervalDays}}</td>
                            </tr>
                            <tr>
                                <td>重用次数间隔</td>
                                <td>{{vm.pwdRule.reuseIntervalNums}}</td>
                            </tr>
                            <tr>
                                <td>复杂度</td>
                                <td>{{vm.pwdRule.pattern}}</td>
                            </tr>
                            <tr>
                                <td>描述</td>
                                <td class="text-left">{{vm.pwdRule.remark}}</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <!--login end-->
</div>